package top.itmeans.yes.portal.service.impl;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.itmeans.yes.entity.OrderReturnApply;
import top.itmeans.yes.mapper.OrderReturnApplyMapper;
import top.itmeans.yes.portal.domain.OrderReturnApplyParam;
import top.itmeans.yes.portal.service.PortalOrderReturnApplyService;

import java.time.LocalDateTime;

/**
 * 订单退货管理Service实现类
 * @author Yiming.Cao
 */
@Service
public class PortalOrderReturnApplyServiceImpl implements PortalOrderReturnApplyService {
    @Autowired
    private OrderReturnApplyMapper returnApplyMapper;
    @Override
    public int create(OrderReturnApplyParam returnApply) {
        OrderReturnApply realApply = new OrderReturnApply();
        BeanUtils.copyProperties(returnApply,realApply);
        realApply.setCreateTime(LocalDateTime.now());
        realApply.setStatus(0);
        return returnApplyMapper.insert(realApply);
    }
}
